import 'package:factoryside/bean/recharge_record_entity.dart';

rechargeRecordEntityFromJson(RechargeRecordEntity data, Map<String, dynamic> json) {
	if (json['Id'] != null) {
		data.id = json['Id'] is String
				? int.tryParse(json['Id'])
				: json['Id'].toInt();
	}
	if (json['FinancialID'] != null) {
		data.financialID = json['FinancialID'] is String
				? int.tryParse(json['FinancialID'])
				: json['FinancialID'].toInt();
	}
	if (json['PayTypeCode'] != null) {
		data.payTypeCode = json['PayTypeCode'].toString();
	}
	if (json['PayTypeName'] != null) {
		data.payTypeName = json['PayTypeName'].toString();
	}
	if (json['PayMoney'] != null) {
		data.payMoney = json['PayMoney'] is String
				? double.tryParse(json['PayMoney'])
				: json['PayMoney'].toDouble();
	}
	if (json['ThirdPartyNo'] != null) {
		data.thirdPartyNo = json['ThirdPartyNo'];
	}
	if (json['OutTradeNo'] != null) {
		data.outTradeNo = json['OutTradeNo'];
	}
	if (json['State'] != null) {
		data.state = json['State'].toString();
	}
	if (json['StateName'] != null) {
		data.stateName = json['StateName'].toString();
	}
	if (json['IsInvoice'] != null) {
		data.isInvoice = json['IsInvoice'].toString();
	}
	if (json['OrderID'] != null) {
		data.orderID = json['OrderID'] is String
				? int.tryParse(json['OrderID'])
				: json['OrderID'].toInt();
	}
	if (json['UserID'] != null) {
		data.userID = json['UserID'].toString();
	}
	if (json['BisID'] != null) {
		data.bisID = json['BisID'];
	}
	if (json['BuyerAccount'] != null) {
		data.buyerAccount = json['BuyerAccount'];
	}
	if (json['ActualMoney'] != null) {
		data.actualMoney = json['ActualMoney'] is String
				? int.tryParse(json['ActualMoney'])
				: json['ActualMoney'].toInt();
	}
	if (json['ShareMoney'] != null) {
		data.shareMoney = json['ShareMoney'] is String
				? int.tryParse(json['ShareMoney'])
				: json['ShareMoney'].toInt();
	}
	if (json['ShareUserId'] != null) {
		data.shareUserId = json['ShareUserId'];
	}
	if (json['Name'] != null) {
		data.name = json['Name'];
	}
	if (json['LastTimeTotalMoney'] != null) {
		data.lastTimeTotalMoney = json['LastTimeTotalMoney'] is String
				? int.tryParse(json['LastTimeTotalMoney'])
				: json['LastTimeTotalMoney'].toInt();
	}
	if (json['TotalMoney'] != null) {
		data.totalMoney = json['TotalMoney'] is String
				? int.tryParse(json['TotalMoney'])
				: json['TotalMoney'].toInt();
	}
	if (json['UpdateTime'] != null) {
		data.updateTime = json['UpdateTime'].toString();
	}
	if (json['LastUpdateTime'] != null) {
		data.lastUpdateTime = json['LastUpdateTime'].toString();
	}
	if (json['CASID'] != null) {
		data.cASID = json['CASID'] is String
				? int.tryParse(json['CASID'])
				: json['CASID'].toInt();
	}
	if (json['Type'] != null) {
		data.type = json['Type'];
	}
	if (json['CompanyName'] != null) {
		data.companyName = json['CompanyName'];
	}
	if (json['page'] != null) {
		data.page = json['page'] is String
				? int.tryParse(json['page'])
				: json['page'].toInt();
	}
	if (json['limit'] != null) {
		data.limit = json['limit'] is String
				? int.tryParse(json['limit'])
				: json['limit'].toInt();
	}
	if (json['StartTime'] != null) {
		data.startTime = json['StartTime'];
	}
	if (json['EndTime'] != null) {
		data.endTime = json['EndTime'];
	}
	if (json['StateList'] != null) {
		data.stateList = new List<dynamic>();
		data.stateList.addAll(json['StateList']);
	}
	if (json['CreateTime'] != null) {
		data.createTime = json['CreateTime'].toString();
	}
	if (json['CreateUserID'] != null) {
		data.createUserID = json['CreateUserID'].toString();
	}
	if (json['UpdateUserID'] != null) {
		data.updateUserID = json['UpdateUserID'];
	}
	if (json['IsUse'] != null) {
		data.isUse = json['IsUse'].toString();
	}
	if (json['Version'] != null) {
		data.version = json['Version'] is String
				? int.tryParse(json['Version'])
				: json['Version'].toInt();
	}
	return data;
}

Map<String, dynamic> rechargeRecordEntityToJson(RechargeRecordEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['Id'] = entity.id;
	data['FinancialID'] = entity.financialID;
	data['PayTypeCode'] = entity.payTypeCode;
	data['PayTypeName'] = entity.payTypeName;
	data['PayMoney'] = entity.payMoney;
	data['ThirdPartyNo'] = entity.thirdPartyNo;
	data['OutTradeNo'] = entity.outTradeNo;
	data['State'] = entity.state;
	data['StateName'] = entity.stateName;
	data['IsInvoice'] = entity.isInvoice;
	data['OrderID'] = entity.orderID;
	data['UserID'] = entity.userID;
	data['BisID'] = entity.bisID;
	data['BuyerAccount'] = entity.buyerAccount;
	data['ActualMoney'] = entity.actualMoney;
	data['ShareMoney'] = entity.shareMoney;
	data['ShareUserId'] = entity.shareUserId;
	data['Name'] = entity.name;
	data['LastTimeTotalMoney'] = entity.lastTimeTotalMoney;
	data['TotalMoney'] = entity.totalMoney;
	data['UpdateTime'] = entity.updateTime;
	data['LastUpdateTime'] = entity.lastUpdateTime;
	data['CASID'] = entity.cASID;
	data['Type'] = entity.type;
	data['CompanyName'] = entity.companyName;
	data['page'] = entity.page;
	data['limit'] = entity.limit;
	data['StartTime'] = entity.startTime;
	data['EndTime'] = entity.endTime;
	if (entity.stateList != null) {
		data['StateList'] =  [];
	}
	data['CreateTime'] = entity.createTime;
	data['CreateUserID'] = entity.createUserID;
	data['UpdateUserID'] = entity.updateUserID;
	data['IsUse'] = entity.isUse;
	data['Version'] = entity.version;
	return data;
}